//
//  ViewController.m
//  23_加密
//
//  Created by dllo on 16/8/16.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "ViewController.h"
#import "NSString+LSTMD5.h"
#import "NSString+LSTSHA_1.h"
#import "NSString+PFLBase64.h"
#import "NSString+PFDES.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//     MD5 SHA-1 单向散列函数， 算法
//   1.MD5验证算法， 一般用于验证密码
   NSString *afterMD5 = @"Hello";
    NSString *final32BtMD5Lower = [afterMD5 stringWith32BitMD5Lower];
    NSString *final32BtMD5Upper = [afterMD5 stringWith64BitMD5Upper];
    NSString *final16BtMD5lower = [afterMD5 stringWith16BitMD5Lower];
    NSString *final16BtMD5Upper = [afterMD5 stringWith16BitMD5Upper];
    NSLog(@"32bit 小写%@", final32BtMD5Lower);
     NSLog(@"32bit 大写%@", final32BtMD5Upper);
     NSLog(@"16bit 小写%@", final16BtMD5lower);
     NSLog(@"16bit 大写%@", final16BtMD5Upper);
//    2. SHA-1
    NSString *afterSHA_1 = @"HELLO";
    NSString *finalSHA_1String = [afterSHA_1 stringwithSHA_1];
    NSLog(@"%@", finalSHA_1String);
//    3.base64
    NSString *afterBase64 = @"hello";
   NSString *base64 = [afterBase64 stringWithBase64];
    
    NSLog(@"base64 : %@", base64);
    NSString *finalString = [base64 base64WithString];
    NSLog(@"%@", finalString);
    
    NSString *pathString = @"http://c.m.163.com/search/comp/MA%3D%3D/%@.html";
   NSString *string = [pathString base64WithString];
    NSLog(@"string-- %@",string);
    
  //4.对称加密
   //三种算法 DES 3重DES AES
    NSString *string1 = @"12356789";
   NSString *desString = [string1 stringWithDES];
    NSLog(@"desString %@", desString);
    NSString *source = [desString desWithString];
    NSLog(@"%@", source);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
